using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Fields
{
    /// <summary>
    /// <para>Reclassify Field</para>
    /// <para>Reclassifies values in a numerical or text field into classes based on bounds defined manually or using a reclassification method.</para>
    /// <para>根据手动定义的边界或使用重分类方法，将数值或文本字段中的值重新分类为类。</para>
    /// </summary>    
    [DisplayName("Reclassify Field")]
    public class ReclassifyField : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ReclassifyField()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_table">
        /// <para>Input Table</para>
        /// <para>The input table or feature class containing the field to be reclassified.</para>
        /// <para>包含要重新分类的字段的输入表或要素类。</para>
        /// </param>
        /// <param name="_field">
        /// <para>Field to Reclassify</para>
        /// <para>The field to be reclassified. The field must be numeric or text.</para>
        /// <para>要重新分类的字段。该字段必须为数字或文本。</para>
        /// </param>
        public ReclassifyField(object _in_table, object _field)
        {
            this._in_table = _in_table;
            this._field = _field;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Reclassify Field";

        public override string CallName => "management.ReclassifyField";

        public override List<string> AcceptEnvironments => ["extent"];

        public override object[] ParameterInfo => [_in_table, _field, _method.GetGPValue(), _classes, _interval, _standard_deviations.GetGPValue(), _reclass_table, _reverse_values.GetGPValue(), _output_field_name, _updated_table];

        /// <summary>
        /// <para>Input Table</para>
        /// <para>The input table or feature class containing the field to be reclassified.</para>
        /// <para>包含要重新分类的字段的输入表或要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_table { get; set; }


        /// <summary>
        /// <para>Field to Reclassify</para>
        /// <para>The field to be reclassified. The field must be numeric or text.</para>
        /// <para>要重新分类的字段。该字段必须为数字或文本。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Field to Reclassify")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _field { get; set; }


        /// <summary>
        /// <para>Reclassification Method</para>
        /// <para><xdoc>
        ///   <para>Specifies how the values contained in the field specified in the Field to Reclassify parameter.</para>
        ///   <bulletList>
        ///     <bullet_item>Defined interval— Creates classes with the same class range over the span of the values of the field to reclassify.</bullet_item><para/>
        ///     <bullet_item>Equal interval—Creates classes with equal class ranges divided into a specified number of classes. This is the default.</bullet_item><para/>
        ///     <bullet_item>Geometric interval—Creates classes with geometrically increasing or decreasing class ranges into a specified number of classes.</bullet_item><para/>
        ///     <bullet_item>Manual interval— Class breaks and reclassed values are manually specified.</bullet_item><para/>
        ///     <bullet_item>Natural breaks (Jenks)— Creates classes of natural groupings in the data using the Jenks natural breaks algorithm.</bullet_item><para/>
        ///     <bullet_item>Quantile— Creates classes where each class includes an equal number of values.</bullet_item><para/>
        ///     <bullet_item>Standard deviation— Creates classes by adding and subtracting a fraction of the standard deviation above and below the average value.</bullet_item><para/>
        ///     <bullet_item>Unique values—Creates classes where each unique value of the field becomes a class.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定“要重新分类的字段”参数中指定的字段中包含的值。</para>
        ///   <bulletList>
        ///     <bullet_item>定义间隔 - 在要重新分类的字段值的跨度内创建具有相同类范围的类。</bullet_item><para/>
        ///     <bullet_item>相等间隔 （Equal interval） - 创建具有相等类范围的类，这些类范围划分为指定数量的类。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>几何间隔 （Geometric interval） - 将几何递增或递减类范围创建为指定数量的类。</bullet_item><para/>
        ///     <bullet_item>手动间隔 — 手动指定类中断和重新分类的值。</bullet_item><para/>
        ///     <bullet_item>自然中断 （Jenks） - 使用 Jenks 自然中断算法在数据中创建自然分组的类。</bullet_item><para/>
        ///     <bullet_item>分位数 — 创建每个类包含相同数量的值的类。</bullet_item><para/>
        ///     <bullet_item>标准差 - 通过在平均值上方和下方添加和减去标准差的一小部分来创建类。</bullet_item><para/>
        ///     <bullet_item>唯一值 - 创建类，其中字段的每个唯一值都成为一个类。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Reclassification Method")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _method_value _method { get; set; } = _method_value._EQUAL_INTERVAL;

        public enum _method_value
        {
            /// <summary>
            /// <para>Defined interval</para>
            /// <para>Defined interval— Creates classes with the same class range over the span of the values of the field to reclassify.</para>
            /// <para>定义间隔 - 在要重新分类的字段值的跨度内创建具有相同类范围的类。</para>
            /// </summary>
            [Description("Defined interval")]
            [GPEnumValue("DEFINED_INTERVAL")]
            _DEFINED_INTERVAL,

            /// <summary>
            /// <para>Equal interval</para>
            /// <para>Equal interval—Creates classes with equal class ranges divided into a specified number of classes. This is the default.</para>
            /// <para>相等间隔 （Equal interval） - 创建具有相等类范围的类，这些类范围划分为指定数量的类。这是默认设置。</para>
            /// </summary>
            [Description("Equal interval")]
            [GPEnumValue("EQUAL_INTERVAL")]
            _EQUAL_INTERVAL,

            /// <summary>
            /// <para>Geometric interval</para>
            /// <para>Geometric interval—Creates classes with geometrically increasing or decreasing class ranges into a specified number of classes.</para>
            /// <para>几何间隔 （Geometric interval） - 将几何递增或递减类范围创建为指定数量的类。</para>
            /// </summary>
            [Description("Geometric interval")]
            [GPEnumValue("GEOMETRIC_INTERVAL")]
            _GEOMETRIC_INTERVAL,

            /// <summary>
            /// <para>Manual interval</para>
            /// <para>Manual interval— Class breaks and reclassed values are manually specified.</para>
            /// <para>手动间隔 — 手动指定类中断和重新分类的值。</para>
            /// </summary>
            [Description("Manual interval")]
            [GPEnumValue("MANUAL")]
            _MANUAL,

            /// <summary>
            /// <para>Natural breaks (Jenks)</para>
            /// <para>Natural breaks (Jenks)— Creates classes of natural groupings in the data using the Jenks natural breaks algorithm.</para>
            /// <para>自然中断 （Jenks） - 使用 Jenks 自然中断算法在数据中创建自然分组的类。</para>
            /// </summary>
            [Description("Natural breaks (Jenks)")]
            [GPEnumValue("NATURAL_BREAKS")]
            _NATURAL_BREAKS,

            /// <summary>
            /// <para>Quantile</para>
            /// <para>Quantile— Creates classes where each class includes an equal number of values.</para>
            /// <para>分位数 — 创建每个类包含相同数量的值的类。</para>
            /// </summary>
            [Description("Quantile")]
            [GPEnumValue("QUANTILE")]
            _QUANTILE,

            /// <summary>
            /// <para>Standard deviation</para>
            /// <para>Standard deviation— Creates classes by adding and subtracting a fraction of the standard deviation above and below the average value.</para>
            /// <para>标准差 - 通过在平均值上方和下方添加和减去标准差的一小部分来创建类。</para>
            /// </summary>
            [Description("Standard deviation")]
            [GPEnumValue("STANDARD_DEVIATION")]
            _STANDARD_DEVIATION,

            /// <summary>
            /// <para>Unique values</para>
            /// <para>Unique values—Creates classes where each unique value of the field becomes a class.</para>
            /// <para>唯一值 - 创建类，其中字段的每个唯一值都成为一个类。</para>
            /// </summary>
            [Description("Unique values")]
            [GPEnumValue("UNIQUE_VALUES")]
            _UNIQUE_VALUES,

        }

        /// <summary>
        /// <para>Number of Classes</para>
        /// <para>The target number of classes in the reclassified field. The maximum number of classes is 256.</para>
        /// <para>重新分类字段中的目标类数。最大类数为 256。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of Classes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public long? _classes { get; set; } = null;


        /// <summary>
        /// <para>Interval Size</para>
        /// <para>The class interval size for the reclassified field. The provided value must result in at least 3 classes and not more than 1000 classes.</para>
        /// <para>重新分类字段的类间隔大小。提供的值必须至少生成 3 个类，但不超过 1000 个类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Interval Size")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _interval { get; set; } = null;


        /// <summary>
        /// <para>Number of Standard Deviations</para>
        /// <para><xdoc>
        ///   <para>Specifies the number of standard deviations for the reclassified field. Class breaks and categories are created with equal interval ranges that are a proportion of the standard deviation from the mean.</para>
        ///   <bulletList>
        ///     <bullet_item>One standard deviation—Intervals are created using one standard deviation. This is the default.</bullet_item><para/>
        ///     <bullet_item>One half of a standard deviation—Intervals are created using half of one standard deviation.</bullet_item><para/>
        ///     <bullet_item>One third of a standard deviation—Intervals are created using a third of one standard deviation.</bullet_item><para/>
        ///     <bullet_item>One quarter of a standard deviation—Intervals are created using a quarter of one standard deviation.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定重新分类字段的标准差数。使用相等的间隔范围创建类间隔和类别，这些间隔范围是与平均值的标准差的比例。</para>
        ///   <bulletList>
        ///     <bullet_item>一个标准差 - 使用一个标准差创建区间。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>标准差的一半 - 使用一个标准差的一半创建区间。</bullet_item><para/>
        ///     <bullet_item>标准差的三分之一 - 使用一个标准差的三分之一创建区间。</bullet_item><para/>
        ///     <bullet_item>标准差的四分之一 - 使用一个标准差的四分之一创建区间。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of Standard Deviations")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _standard_deviations_value _standard_deviations { get; set; } = _standard_deviations_value._ONE;

        public enum _standard_deviations_value
        {
            /// <summary>
            /// <para>One standard deviation</para>
            /// <para>One standard deviation—Intervals are created using one standard deviation. This is the default.</para>
            /// <para>一个标准差 - 使用一个标准差创建区间。这是默认设置。</para>
            /// </summary>
            [Description("One standard deviation")]
            [GPEnumValue("ONE")]
            _ONE,

            /// <summary>
            /// <para>One half of a standard deviation</para>
            /// <para>One half of a standard deviation—Intervals are created using half of one standard deviation.</para>
            /// <para>标准差的一半 - 使用一个标准差的一半创建区间。</para>
            /// </summary>
            [Description("One half of a standard deviation")]
            [GPEnumValue("HALF")]
            _HALF,

            /// <summary>
            /// <para>One third of a standard deviation</para>
            /// <para>One third of a standard deviation—Intervals are created using a third of one standard deviation.</para>
            /// <para>标准差的三分之一 - 使用一个标准差的三分之一创建区间。</para>
            /// </summary>
            [Description("One third of a standard deviation")]
            [GPEnumValue("THIRD")]
            _THIRD,

            /// <summary>
            /// <para>One quarter of a standard deviation</para>
            /// <para>One quarter of a standard deviation—Intervals are created using a quarter of one standard deviation.</para>
            /// <para>标准差的四分之一 - 使用一个标准差的四分之一创建区间。</para>
            /// </summary>
            [Description("One quarter of a standard deviation")]
            [GPEnumValue("QUARTER")]
            _QUARTER,

        }

        /// <summary>
        /// <para>Reclassification Table</para>
        /// <para>The upper bound and reclassed value for the manual reclassification method.</para>
        /// <para>手动重分类方法的上限和重分类值。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Reclassification Table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _reclass_table { get; set; } = null;


        /// <summary>
        /// <para>Reverse Values (Descending)</para>
        /// <para><xdoc>
        ///   <para>Specifies how the reclassified values are ordered.
        ///   <bulletList>
        ///     <bullet_item>Checked—Classes are assigned values in descending order; the class with the highest values is assigned 1, the next highest class is assigned 2, and so on.  </bullet_item><para/>
        ///     <bullet_item>Unchecked—Classes are assigned values in ascending order; the class with the lowest values is assigned 1, the next lowest class is assigned 2, and so on. This is the default.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        /// <para>指定重新分类值的排序方式。
        ///   <bulletList>
        ///     <bullet_item>选中 （Checked） - 按降序分配类值;具有最高值的类被分配 1，下一个最高的类被分配 2，依此类推。 </bullet_item><para/>
        ///     <bullet_item>未选中 - 按升序分配类值;值最低的类被分配 1，下一个最低的类被分配 2，依此类推。这是默认设置。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Reverse Values (Descending)")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _reverse_values_value _reverse_values { get; set; } = _reverse_values_value._false;

        public enum _reverse_values_value
        {
            /// <summary>
            /// <para>DESC</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DESC")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>ASC</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ASC")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Output Field Name</para>
        /// <para>The name or prefix of the output field. If the field to reclassify is a numerical field, two fields will be created, and this name will prefix the field names. If the field to reclassify is a text field, one new field will be created with this name.</para>
        /// <para>输出字段的名称或前缀。如果要重新分类的字段是数字字段，则将创建两个字段，并且此名称将作为字段名称的前缀。如果要重新分类的字段是文本字段，则将创建一个具有此名称的新字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Field Name")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _output_field_name { get; set; } = null;


        /// <summary>
        /// <para>Updated Input Table</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _updated_table { get; set; }


        public ReclassifyField SetEnv(object extent = null)
        {
            base.SetEnv(extent: extent);
            return this;
        }

    }

}